import { defineStore } from 'pinia'
import { queryPermissionsByUser } from '@/api/api'
const permissionStore = defineStore({
  id: 'permission', 
  state: () => {
    return {
        authMenuList: [],
    }
  },
  getters: {
   // 后端返回的菜单列表
		authMenuListGet: state => state.authMenuList,
  },
  actions: {
    // getAuthMenuList
		async getAuthMenuList(params) {
			const response = await queryPermissionsByUser(params)
      const menu = response.result.menu
			this.authMenuList = menu;
		},
  },
})

export default permissionStore